
//
//  UIBarButtonItem+Extension.swift
//  新浪微博
//
//  Created by bin on 16/1/23.
//  Copyright © 2016年 XMG. All rights reserved.
//

import UIKit

extension UIBarButtonItem{
    
    convenience init(image: String, target: AnyObject?, action: Selector){
        let btn = UIButton()
        btn.setImage(UIImage(named: image), forState: .Normal)
        btn.setImage(UIImage(named: image + "_highlighted"), forState: .Highlighted)
        btn.addTarget(target, action: action, forControlEvents: .TouchUpInside)
        btn.sizeToFit()
        
        self.init(customView: btn)
        
    }
}